{% extends "base.html" %}

{% load tags %}

{% block style %}
h1{
text-align: center;
}

.table_border
{
border:1px solid black;
border-collapse:collapse;
width:100%;
caption-side:top;
}

.table_border td
{
border:1px solid black;
border-collapse:uncollapse;
word-wrap:break-word;
overflow:hidden;
padding:15px;
}

.table_noborder
{
border:0px;
width:100%;
border-collapse:separate;
border-spacing:0px 0px;
table-layout:automatic;
}

.table_noborder td
{
border:0px;
word-wrap:break-word;
overflow:hidden;
padding:5px;
}

.info_nr{
text-align: left;
background-color: lightgray;
}

.info_date{
text-align: right;
background-color: lightgray;
}

blockquote{
background-color: lightyellow;
font-style:italic;
font-size: 100%;
}

.quote{
background-color: lightyellow;
font-style:italic;
font-size: 100%;
}

.context{
<!--background-color: lightgreen;-->
}

{% endblock %}

{% block title %}{{ post.title }} {% endblock %}

{% block head-others %}
<!-- <script type="text/javascript" src="/scripts/common.js"></script>-->
{% endblock %}

{% block head-script %}
<!--function thumbImg(var1)-->
<!--{-->
<!--alert("thumbImg called")-->
<!--}-->
<!--function imgresize(var1)-->
<!--{-->
<!--alert("imgresize called")-->
<!--}-->
<!--function myfunction(txt)-->
<!--{-->
<!--alert(txt)-->
<!--}-->

{% endblock %}

{% block body-script %}
{% endblock %}

{% block body-title %} <h1 >{{ post.title }}</h1> {% endblock %}

{% block content %}

<hr> </hr>
{% if rl %}
    <p align="center"><b><a href="{% url index %}">index</a></b>&nbsp;
    <b><a href="{% url postlist%}">postlist</a></b>&nbsp;
    <b> {{ post.sector.name }}  total {{ total }} item{{ total|pluralize }}, {{ max_page }} page{{ max_page|pluralize}} .this is page {{ page }} from {{ item_from }}</b></p>

    <table class="table_border">
    <caption>{{ post.title }} <p align="right"> {% ReplyListUrlPages post page max_page as pagelist %} &nbsp;&nbsp;&nbsp;</p></caption>
    {% for item in rl %}
        <tr>
        <td>
        <table class="table_noborder">
        <tr>
        <td class="info_nr" >
        <a href="{{item.id}}-{{item.locate_id}}">#{{forloop.counter|add:item_from}}</a>  {{item.author}}
        </td>
        <td class="info_date" >
        {{ item.crt_date|date:"Y-m-d H:i:s"}}
        </td>
        <tr>
        </table>

        <hr size="1" >
<!--        <span class="context" > {{ item.content|ProcessRelateUrl:post.sector.base_url}} </span>-->
        <span class="context" > {% ProcessUrl item.content post.sector.base_url %} </span>
        </td>
        </tr>
    {% endfor %}

    </table>

    <p align="right"> {% ReplyListUrlPages post page max_page as pagelist%} &nbsp;&nbsp;&nbsp;</p>

{% else %}
    <p>No post are available.</p>
{% endif %}

{% endblock %}